package com.piece.core.verifycode.util;

import com.piece.core.framework.constant.SecurityConstants;
import com.piece.core.verifycode.enums.ValidateCodeType;

public class ValidateCodeUtil {

    /**
     * 获取校验码的类型
     */
    public static ValidateCodeType getValidateCodeType(String grantType) {
        ValidateCodeType result = null;

        switch (grantType) {
            case SecurityConstants.MOBILE_CODE:
                result = ValidateCodeType.SMS;
                break;
            case SecurityConstants.USERNAME_CODE:
            default:
                result = ValidateCodeType.CAPTCHA;
        }
        return result;
    }
}
